home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / games / 73 / pascal / rndtest.pas < prev    next >
Pascal/Delphi Source File  |  1986-11-21  |  2KB  |  58 lines

  1. { -----------------------------------------------------------------------------
  2.  
  3.                                  NOTICE:
  4.  
  5.       THESE MATERIALS are UNSUPPORTED by OSS!  If you do not understand how to
  6.       use them do not contact OSS for help!  We will not teach you how to 
  7.       program in Pascal.  If you find an error in these materials, feel free
  8.       to SEND US A LETTER explaining the error, and how to fix it.
  9.  
  10.       THE BOTTOM LINE:
  11.  
  12.          Use it, enjoy it, but you are on your own when using these materials!
  13.  
  14.  
  15.                                DISCLAIMER:
  16.  
  17.       OSS makes no representations or warranties with respect to the contents
  18.       hereof and specifically disclaim all warranties of merchantability or
  19.       fitness for any particular purpose.   This document is subject to change
  20.       without notice.
  21.       
  22.       OSS provides these materials for use with Personal Pascal.  Use them in
  23.       any way you wish.
  24.  
  25.    -------------------------------------------------------------------------- }
  26.  
  27.  
  28. PROGRAM Test_Random;
  29.  
  30. {***************************************************************************
  31.  
  32.         Program to test random number functions in Personal Pascal.
  33.         October 1, 1986 MJC
  34.  
  35.         Copyright 1986 OSS
  36.  
  37.         >>  Compile for TOS!!  <<
  38.  
  39. *****************************************************************************}
  40.  
  41. VAR
  42.    i : Integer;
  43.    DecRand : Real;
  44.    IntRand : Integer;
  45.  
  46. {$I RANDOM.PAS} { include random routines }
  47.  
  48. Begin
  49.   For i := 1 to 100 do
  50.      Begin
  51.         DecRand := Rnd;    { grab number tween 0 and 1 }
  52.         IntRand := Random( 5, 10 ); { grab random int between 5 and 10 }
  53.         Writeln( 'DecRand is ', DecRand:10:8, '  IntRand is ', IntRand );
  54.      End;
  55. End.
  56.  
  57. { END OF RNDTEST.PAS }
  58.